Repository navigation
Clarify required Windows Toast notification configuration - #3333
Merged
Merged
Conversation
Provide an actionable setup exception when Windows Toast notifications are not enabled and clarify that the Snackbar option also enables Toast. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused changes have no blocking findings; only an optional test-warning cleanup remains.
Review effort: Balanced
Findings: 1
What changed in this PR
Improves Windows Toast diagnostics by explaining required notification configuration before attempting to show a notification.
Changes:
- Adds an actionable setup exception while preserving cancellation precedence.
- Clarifies that the Windows Snackbar option also enables Toast.
- Adds tests for enabled and disabled configuration.
| File | Description |
|---|---|
| src/CommunityToolkit.Maui/Options.shared.cs | Clarifies shared Toast and Snackbar setup. |
| src/CommunityToolkit.Maui/Alerts/Toast/Toast.windows.cs | Checks cancellation and configuration before showing Toast. |
| src/CommunityToolkit.Maui/Alerts/Toast/Toast.shared.cs | Adds configuration validation and setup documentation. |
| src/CommunityToolkit.Maui.UnitTests/Alerts/ToastTests.cs | Tests both configuration states. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TheCodeTraveler
approved these changes
Oct 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description of Change
This was prompted by someone on the MAUIverse Discord encountering
COMException 0x80070490: Element not foundwhen showing a Toast on Windows with .NET 10 and CommunityToolkit.Maui 15.0.1. They weren't aware thatSetShouldEnableSnackbarOnWindows(true)is also required for Toast.The configuration is already documented, so this is a diagnostic/usability improvement rather than a fix for a .NET 10 regression. It makes the requirement discoverable from the exception without needing to read the docs first:
InvalidOperationExceptionbefore showing a Windows Toast when the notification option is disabled, including the initialization code, packaged-app manifest guidance, and a documentation HelpLink.If maintainers don't feel this additional guidance is useful, please feel free to close this PR.
Linked Issues
No linked issue; prompted by a MAUIverse Discord support conversation about missing application configuration.
PR Checklist
approved(bug) orChampioned(feature/proposal)mainat time of PRNo sample change is needed: the existing sample already enables the notification option. XML API documentation is updated in this PR; there is no separate MicrosoftDocs PR.
Additional information
Reproduced the original exception in an unpackaged Windows app using .NET 10 and Toolkit NuGet 15.0.1. Registering the Windows notification manager made both first and subsequent Toast calls succeed.
Verified the modified implementation in a WinUI-hosted Windows reproduction: missing configuration produces the actionable setup exception, cancellation still produces
OperationCanceledException, and configured notifications can be shown repeatedly and dismissed. The Windows Toolkit build succeeded and all 22 focused Toast tests passed.